// import React from 'react'
import { h } from 'preact'
import createComponent from 'preact-classless-component'
import Button from 'preact-material-components/esm/Button'
import 'preact-material-components/Button/style.css'
import 'preact-material-components/Theme/style.css'

import { connect } from 'unistore/preact'
import actions from '../../store/actions'



export default connect('count', actions)(createComponent({
    componentWillMount(){
        const { getcount} = this.props
        getcount()
    },
    render: ({ count, increment, decrement, getcount }) => {
        return (
            <div>
                <p>{count}</p>
                111222
                <Button ripple raised onClick={increment}>Increment</Button>
                <Button ripple raised className="mdc-theme--primary-bg" onClick={decrement}>Decrement</Button>
                <Button onClick={getcount}>getcount</Button>
            </div>
        )
    }
}))
